<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>login</title>
		<link rel="stylesheet" type="text/css" href="style/login.css"/>
		<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="js/require.js" data-main ="js/indexreq.js" charset="UTF-8"></script>
	</head>
	<body>
		<div id="login" class="margin">
			<div class="logo"><a href="index.html"><img src="images/t1.png" /></a></div>
			<div class="box">
				<div class="one">
					<span class="log">登录蜜芽</span>
					<span class="lno">
						<i>还没有蜜芽账号？</i>
						<a href="register.html">30秒注册</a>
					</span>
				</div>
				<div class="two">
					<div class="phone">
						<div class="inp">
							<div class="icon"></div>
							<input type="text" placeholder="手机号" />
						</div>
						<div class="warm">请输入正确的手机号码，且为11位纯数字格式</div>
					</div>
					
					<div class="mess">
						<div class="inp">
							<input type="text" placeholder="短信验证码" />
						</div>
						<a href="javascript:;">获取短信验证码</a>
						<div class="warm">验证码输入有误</div>
					</div>
					<div class="btn">
						<a href="javascript:;" class="logbtn">登录</a>
					</div>
				</div>
				<div class="three">
					<p>使用以下账号登录：</p>
					<a href="javascript:;" class="wx" title="使用微信账号登录"></a>
					<a href="javascript:;" class="wb"></a>
				</div>
			</div>
		</div>
		<div class="text">Copyright ©2017 北京花旺在线商贸有限公司 Miyabaobei.com 保留一切权利。客服热线： 400-789-2000。京ICP证140430号 京ICP备14006215号</div>
		
		<script type="text/javascript">
			/*function random(min,max){    //随机数
				return parseInt(Math.random()*(max-min+1)+min);
			}
			
			$(function(){
				var $phone=$('#login .two .phone input');
				var $mesg=$('#login .mess .inp input');
				var $getbtn=$('#login .two .mess a');
				var $warm1=$('#login .phone .warm');
				var $warm2=$('#login .mess .warm');
				var $logbtn=$('#login .btn .logbtn');
				//验证手机号
				var str=0;
				var reg=/^1[3|5|7]\d{9}$/;
				$phone.on('keyup',function(){   
					str=$phone.val();
					$warm1.css('display','none');
					if(str!=''){
						if(reg.test(str)){
							$warm1.css('display','none');
						}else{
							$warm1.css('display','block');
//							$warm1.text('请输入正确的手机号码');
						}
					}
				});
				//获取短信验证码
				$getbtn.on('click',function(){
					var str1='';
					for(var i=1;i<=4;i++){
						str1+=random(0,9);
					}
					$mesg.val(str1);
					$warm2.css('display','none');
				});
				//点击登录按钮
				$logbtn.on('click',function(){
					var pho=$phone.val();
					if(!reg.test(str)){
						if($mesg.val()==''){
							$warm2.css('display','block');
						}
						$warm1.css('display','block');
					}else{
						if($mesg.val()==''){
							$warm2.css('display','block');
						}else{
							$.ajax({
								type:"post",
								url:"php/login.php",
								data:{
									str:pho
								},
								success:function(data){
									if(!data){
										$warm1.css('display','block');
										$warm1.text('请输入正确的手机号码，且为11位纯数字格式');
									}else{
										location.href='index.html';
									}
								}
							});
						}
					}
				});
			});*/
		</script>
		
	</body>
</html>
